#error This old implementation should be deleted soon. Moved in the synchronization_win32.hpp
#include <windows.h>

namespace glf {

struct Mutex::Impl {
	Impl(int) {
		InitializeCriticalSection(&mCritSection);
	}
	~Impl()
	{
		DeleteCriticalSection(&mCritSection);
	}

	void Lock() {
		EnterCriticalSection(&mCritSection);
	}
	bool TryLock() {
		return TryEnterCriticalSection(&mCritSection) == TRUE;
	}
	void Unlock() {
		LeaveCriticalSection(&mCritSection);
	}
	CRITICAL_SECTION mCritSection;
};

} //namespace glf

